﻿using System;
using System.Collections.Generic;
using System.Web;
using System.ComponentModel;
using EcsSiteDSTableAdapters;
namespace SiteECSWeb
{
    [DataObject]
    public class ProductCategoryBLL
    {
        private ProductCategoryTableAdapter _ProductCatTableAdapter = null;

        protected ProductCategoryTableAdapter ProductCatTableAdapter
        {
            get
            {
                if (_ProductCatTableAdapter == null)
                {
                    _ProductCatTableAdapter = new ProductCategoryTableAdapter();
                }
                return _ProductCatTableAdapter;
            }
        }


        #region SelectProductData
        // Select All Product Table incase data error
        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public EcsSiteDS.ProductCategoryDataTable GetALlProductCatgoryData()
        {
            return ProductCatTableAdapter.GetProductCategoryRowRankData();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, false)]
        public EcsSiteDS.ProductCategoryDataTable GetProductCategoryByProductID(int productID)
        {
            return ProductCatTableAdapter.GetlProductCategoryDataByProdCat_Id(productID);
        }
        // select all Grand father Products Category
        [DataObjectMethodAttribute(DataObjectMethodType.Select, false)]
        public EcsSiteDS.ProductCategoryDataTable GetProductGrandData()
        {
            return ProductCatTableAdapter.GetProductCategoryDataProdGrand();
        }

        // Select all father Product category
        [DataObjectMethodAttribute(DataObjectMethodType.Select, false)]
        public EcsSiteDS.ProductCategoryDataTable GetAllProductFatherData()
        {
            return ProductCatTableAdapter.GetProductCategoryDataProdFather();
        }

        [DataObjectMethodAttribute(DataObjectMethodType.Select, false)]
        public EcsSiteDS.ProductCategoryDataTable GetProductFatherDataByGrandID(int GrandFatherId)
        {
            return ProductCatTableAdapter.GetProductCategoryDataProdFatherByGrandId(GrandFatherId);
        }

        #endregion


    }
}